/**
 * Created by yongzhi on 2015/3/23.
 */
define(['common/js/boss-frame-angular-dev-0.1'],function() {

    diretiveModule.directive("plusPanel", ["$compile", function ($compile) {
        return {
            scope: true,
            restrict: "AE",
            replace: true,
            transclude: true,
            controller: function ($scope) { },
            template: function(tElm, tAttrs){
                var panelTitle = tAttrs.panelTitle;
                var fullScreen = tAttrs.fullScreen=="false"?false:true;
                var templateStr =
                    '<div class="panel panel-none gradient-diag1" ng-class="{fullscreen:fullscreen}">';

                if(panelTitle){
                    templateStr +=
                        '<div class="panel-heading panel-text">'+
                        '<div class="panel-actions pull-right panel-actions-reveal" ng-show="'+fullScreen+'">'+
                        '<span class="panel-actions-reveal-hide animated fadeInRight">'+
                        '<span class="panel-action panel-fullscreen" ng-click="fullscreen=!fullscreen">'+
                        '<i class="fa" ng-class="{\'fa-expand\':!fullscreen,\'fa-compress\':fullscreen}"></i>'+
                        '</span>'+
                        '</span>'+
                        '&nbsp;&nbsp;'+
                        '<i class="fa fa-bars panel-actions-reveal-icon"></i>'+
                        '</div>'+
                        '<div class="panel-title"><span class="panel-title" data-type="text"> '+panelTitle+' </span></div>'+
                        '</div>';
                }

                templateStr +=
                    '<div class="panel-body-collapse collapse in">'+
                    '<div class="panel-body" ng-transclude></div>'+
                    '</div>'+
                    '</div>';

                return templateStr;
            }
        };
    }]);

    diretiveModule.directive("plusTitlePanel",[function(){
        return {
            scope : true,
            restrict : 'AE',
            replace: true,
            transclude: true,
            template : '<div style="text-align: right; overflow: hidden; position: absolute; right: 20px; top: 65px;" ng-transclude></div>'
        };
    }]);
});